//
//  ViewController.m
//  YXInternational
//
//  Created by GMS on 2020/8/28.
//  Copyright © 2020 Arhtur. All rights reserved.
//

#import "ViewController.h"
#import "YXLocalized.h"

@interface ViewController ()

// MARK: 代码控制
@property (weak, nonatomic) IBOutlet UILabel *nomalLabel;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
        
    self.nomalLabel.text = YXLocalizedFromTable(@"代码控制", @"hahaha");
}

- (IBAction)change:(UIButton *)sender {
    
    if ([[[YXLocalized sharedInstance] currentLanguage] isEqualToString:@"zh-Hans"]) {
        [[YXLocalized sharedInstance] setLanguage:@"en"];
    } else {
        [[YXLocalized sharedInstance] setLanguage:@"zh-Hans"];
    }
        
    [self initRootVC];
}

- (void)initRootVC{
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    ViewController *vc = [sb instantiateInitialViewController];
    [UIApplication sharedApplication].keyWindow.rootViewController = vc;
}



@end
